//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_RTPASS_INTERFACE_H
#define _UX_RTPASS_INTERFACE_H

#include "../IRenderTechnique.h"

namespace Engine
{
namespace RenderUtils
{
	struct TRTMessage;


	//
	// Render Technique Custom Pass interface
	//

	class IRTPass
	{
	public:
		enum EPassType
		{
			UNKNOWN		= 0,
			BASE,
			BUILT_IN,
			SET_GL_STATE,
			BIND_TEXTURES,
			SET_RENDER_TARGET,
			CYCLE,
			CUSTOM,
			POSTPROCESS,
			BRANCH,
			SWIZZLE,
		};

	protected:
		typedef void (* PProcessPassProc_t)(void *);
		
		IRTPass		*		_pParent;
		PProcessPassProc_t	_pProc;

		static void _s_DefProcessProc(void *)			{}

	public:
		IRTPass(IRTPass *pParent):
			_pParent(pParent), _pProc(&_s_DefProcessProc)
		{}

		virtual ~IRTPass() {}

		virtual bool ProcessMessage(TRTMessage &) = 0;
		virtual void Free()								{ delete this; }
		
		inline  void Process()							{ _pProc( this ); }

		virtual EPassType GetPassType() const = 0;
	};

//-------------------------------------------------------------------

}	// RenderUtils
}	// Engine

#endif	// _UX_RTPASS_INTERFACE_H